package com.wu.constant.Enum;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * SearchCmsInterventionTypeEnum 搜索cms人工干预类型枚举
 *
 * @author wangying
 * @version 2024/04/17 11:11
 **/
@Getter
@AllArgsConstructor
public enum SearchCmsInterventionTypeEnum {

    /**
     * 歌曲
     */
    MUSIC(1, "music"),
    /**
     * 歌单
     */
    PLAYLIST(4, "playlist"),
    /**
     * 视频
     */
    VIDEO(5, "video"),
    /**
     * 歌手
     */
    ACTOR(2, "actor"),
    /**
     * 专辑
     */
    ALBUM(3, "album"),
    /**
     * 彩铃
     */
    CRBT(115, "crbt"),
    /**
     * 听书
     */
    PODCAST_ALBUM(124, "podcast_album"),
    /**
     * 彩铃视频
     */
    CRBT_VIDEO(170, "crbt_video");

    private final Integer type;

    private final String desc;

    /**
     * 根据type获取SearchCmsInterventionTypeEnum
     *
     * @param type type
     * @return desc
     */
    public static SearchCmsInterventionTypeEnum getDesc(Integer type) {
        for (SearchCmsInterventionTypeEnum value : SearchCmsInterventionTypeEnum.values()) {
            if (value.getType().equals(type)) {
                return value;
            }
        }
        return null;
    }

}
